package com.example.yunhailutong.zhongtan.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;

import com.example.yunhailutong.zhongtan.R;

/**
 * Created by yunhailutong on 2018/9/30.
 */

public class ActivityStart extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        final View view = View.inflate(this, R.layout.activity_start, null);
        setContentView(view);
        AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);
        aa.setDuration(3000);
        view.startAnimation(aa);
        aa.setAnimationListener(new Animation.AnimationListener()
        {
            @Override
            public void onAnimationEnd(Animation arg0) {
                redirectTo();
            }
            @Override
            public void onAnimationRepeat(Animation animation) {}
            @Override
            public void onAnimationStart(Animation animation) {}

        });
        redirectTo();
    }
    private void redirectTo(){
//        if(App.isLogin){
//            Intent intent = new Intent(
//                    this, MainActivity.class);
//            startActivity(intent);
//        }else{
//            Intent intent = new Intent(
//                    this, ActivityLogin.class);
//            startActivity(intent);
//        }

        Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);
        finish();
    }


}

